﻿<UserControl x:Class="Mengsk.ERP.App.ArrvieInDelivery.ArrvieInDeliveryUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="700" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Margin="3" Orientation="Horizontal">
            <TextBlock Text="录入原因" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Margin="3" VerticalAlignment="Center" Width="100" Name="cbbArriveReason">
                <ComboBoxItem>退换货</ComboBoxItem>
                <ComboBoxItem>拒收件返回</ComboBoxItem>
                <ComboBox.SelectedIndex>0</ComboBox.SelectedIndex>
            </ComboBox>

            <TextBlock Text="物流公司" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Margin="3" VerticalAlignment="Center" Width="100" Name="cbbDeliveryCompanies">
                <ComboBoxItem>圆通</ComboBoxItem>
                <ComboBoxItem>申通</ComboBoxItem>
                <ComboBoxItem>国通</ComboBoxItem>
                <ComboBoxItem>中通</ComboBoxItem>
                <ComboBoxItem>韵达</ComboBoxItem>
                <ComboBoxItem>顺丰</ComboBoxItem>
                <ComboBoxItem>EMS</ComboBoxItem>
                <ComboBoxItem>天天</ComboBoxItem>
                <ComboBoxItem>优速</ComboBoxItem>
                <ComboBoxItem>邮政</ComboBoxItem>
                <ComboBoxItem>全峰</ComboBoxItem>
                <ComboBoxItem>汇通</ComboBoxItem>
                <ComboBoxItem>宅急送</ComboBoxItem>
                <ComboBox.SelectedIndex>0</ComboBox.SelectedIndex>
            </ComboBox>
            <TextBlock Text="运单号码" Margin="3" VerticalAlignment="Center"/>
            <TextBox Margin="3" Name="tbDeliveryNumber" VerticalAlignment="Center" Width="100" KeyDown="tbDeliveryNumber_KeyDown" GotFocus="tbDeliveryNumber_GotFocus" />
            <Button Name="btnMakeReturn" Content="标记收到" Margin="3" VerticalAlignment="Center" Width="60" Click="btnMakeReturn_Click"/>
            <Button Name="btnClear" Content="清空" Margin="3" VerticalAlignment="Center"  Width="60" Click="btnClear_Click"/>
            <Button Name="btnImport" Content="导入" Margin="3" VerticalAlignment="Center" Width="60" Click="btnImport_Click"/>
        </StackPanel>

        <TextBlock Text="当前共" Margin="3" Grid.Row="1" FontSize="16" Name="tbCount"/>

        <DataGrid Margin="3" Grid.Row="2" Name="dgvDelivery" AutoGenerateColumns="False" SelectionMode="Extended" SelectionUnit="CellOrRowHeader" CanUserAddRows="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="物流公司" Width="Auto" Binding="{Binding Path=DeliveryCompany}" IsReadOnly="False" />
                <DataGridTextColumn Header="物流编号" Width="Auto" Binding="{Binding Path=DeliveryNumber}" IsReadOnly="True"/>
                <DataGridTextColumn Header="录入原因" Width="Auto" Binding="{Binding Path=ArriveInReason}" IsReadOnly="False"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="DeleteOrder_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
